package com.demo.miya.function.skywalking.log;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import com.demo.miya.utils.ThreadLocalUtils;
import org.apache.commons.lang3.StringUtils;

public class SkyWalkingEndPointConverter extends ClassicConverter {

    @Override
    public String convert(ILoggingEvent event) {
        String endPoint = ThreadLocalUtils.getEndPoint();
        return StringUtils.defaultIfBlank(endPoint, StringUtils.EMPTY);
    }
}
